Posts

Post not yet marked as solved
1 Replies
I added autoreleasepool manually and solved this problem.for(int j=0;j<10000;j++){ @autoreleasepool{ MPSCNNConvolutionDescriptor * conv1descriptor = [MPSCNNConvolutionDescriptor cnnConvolutionDescriptorWithKernelWidth:kernel_x kernelHeight:kernel_y inputFeatureChannels:mem_cast(src_ptr)->shape.z outputFeatureChannels:mem_cast(dst_ptr)->shape.z neuronFilter:filter]; conv1descriptor.strideInPixelsX=stride_w; conv1descriptor.strideInPixelsY=stride_h; conv1descriptor.dilationRateX=dilation_w; conv1descriptor.dilationRateY=dilation_h; MPSCNNConvolution *conv1layer = [[MPSCNNConvolution alloc] initWithDevice:resource->m_device convolutionDescriptor:conv1descriptor kernelWeights:&weight->raw[0] biasTerms:bias flags:MPSCNNConvolutionFlagsNone]; printf("allocated size: %d\n",[resource->m_device currentAllocatedSize]); } }